﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CardInChina.Data.Entity.Entity;

namespace CardInChina.Data.Entity.Interface
{
    public class NewsService
    {
        public IEnumerable<News> GetTopNews(int top)
        {
            using (CICEntities db = new CICEntities())
            {
                return db.News
                    .Where(p => p.Status != 1)
                    .OrderByDescending(p => p.OrderValue)
                    .Take(top).ToArray();
            }
        }
    }
}
